import Api from "@/api/thirdGames/supplier";
import i18n from "@/lang/index";
const modalConfig = {
  pageName: 'sys:user',
  dialog: {
    title: i18n.global.t('title.6'),
    width: 800,
    appendToBody: true,
    draggable: true,
    labelWidth: "auto",
  },
  formAction: (data) => {
    console.log('edit', data)
    return new Promise((resolve, reject) => {
      Api.put(data).then((s) => {
        console.log(s)
        resolve(s)
      }).catch((e) => {
        reject(e)
      })
    })
  },
  formItems: [
    {
      type: "input",
      label: "ID",
      prop: "id",
      attrs: {
        disabled: true
      },
    },
    {
      type: "input",
      label: i18n.global.t("form.8"),
      prop: "name",
      attrs: {
        placeholder: i18n.global.t("hint.19"),
      },
    },
    {
      type: "upload",
      label: i18n.global.t("form.10"),
      prop: "image",
      attrs: {
        placeholder: i18n.global.t("hint.21"),
      },
    },
    {
      type: "input",
      label: "code",
      prop: "code",
      attrs: {
        placeholder: i18n.global.t("hint.23"),
      }
    },
    {
      type: "input",
      label: i18n.global.t("form.12"),
      prop: "sort",
      attrs: {
        placeholder: i18n.global.t("hint.24"),
      }
    },
    {
      type: "select",
      label: i18n.global.t("form.48"),
      prop: "status",
      options: [
        { label: i18n.global.t("status.27"), value: 1 },
        { label: i18n.global.t("status.28"), value: 0 },
      ],
      initialValue: 1,
    }
  ],
  formRules: {
    name: [{ required: true, message: i18n.global.t("hint.19"), trigger: "blur" }],
    code: [{ required: true, message: i18n.global.t("hint.23"), trigger: "blur" }],
    sort: [{ required: true, message: i18n.global.t("hint.24"), trigger: "blur" }],
    status: [{ required: true, message: i18n.global.t("请选择"), trigger: "blur" }]
  },
}

export default modalConfig
